/**
 * 冒泡排序函数
 * aa bb cc
 * @param a 待排序的数组
 * @param n 待排序的数组长度
 */
public static void bubbleSort(int [] a, int n){

	bubbleSort(a, 0, n-1);
} //end

public static void bubbleSort(int [] a, int low, int high) {

    if (low >= high) return;

    int pilot = a[high];
    int i = low;

    for (int j = low; j < high; j++) {
    	if (a[j] < pilot) {
            int tmp = a[j];
	    a[j] = a[i];
	    a[i] = tmp;
	    i++;
	}	
    }

    a[high] = a[i];
    a[i] = pilot;

    bubbleSort(a, low, i-1);
    bubbleSort(a, i+1, high);

}
